<template>
  <z-button type="primary" @click="showDrawer">Open</z-button>
  <z-drawer
    v-model:visible="visible"
    class="custom-class"
    style="color: red"
    title="Basic Drawer"
    placement="right"
    @after-visible-change="afterVisibleChange"
  >
    <p>Some contents...</p>
    <p>Some contents...</p>
    <p>Some contents...</p>
  </z-drawer>
</template>

<script>
import { defineComponent, ref } from 'vue'

export default defineComponent({
  setup() {
    const visible = ref(false)

    const afterVisibleChange = bool => {
      console.log('visible', bool)
    }

    const showDrawer = () => {
      visible.value = true
    }

    return {
      visible,
      afterVisibleChange,
      showDrawer
    }
  }

})
</script>
